@layout("/backend/common/_container.html"){
<div class="row row-lg" id="userInfoForm">
    <div class="col-sm-12 dhcc-form">
        <div class="ibox float-e-margins">
            <div class="ibox-content" style="border:none !important; ">
                <div class="form-horizontal">

                    <input type="hidden" id="id" value="${user.id}">
                    <input type="hidden" id="sexValue" value="${user.sex}">

                    <div class="row">
                        <div class="col-sm-12">
                            <!-- <#Image id="avatar" name="头像" value="${user.avatar}"/> -->
                            
                            <#Input id="loginName" name="登录名" value="${user.loginName}"  readonly="readonly" />
                            
                            <#Input id="name" name="姓名" value="${user.name}"/>
                            
                            <#Input id="userCode" name="工号" value="${user.userCode}"  readonly="readonly" />

                            <#Radio id="sex" name="性别" code="sex" value="${user.sex}"/>
                            
                            <#Date id="birthday" name="出生日期" value="${user.birthday}"/>

                            <#Input id="email" name="邮箱" type="email" value="${user.email}"/>
                            
                            <#Input id="phone" name="电话" type="telephone" value="${user.phone}"/>
                            
            				<#SelectTree id="position" name="职务" url="/position/tree" value="${position.id}" textValue="${position.name}" readonly="true"/>
            				
                            <input name="weight" type="hidden" value="${user.weight}"/>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">主部门</label>
                                <div class="col-sm-9">
                                    <table class="table table-bordered">
                                        <thead>
                                            <tr>
                                                <th width="40%">部门</th>
                                                <th>角色</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            @var hasMan = false;
                                            @if(!isEmpty(deptRoles)){
                                                @for(ele in deptRoles){
                                                    @if(ele.isPartTime==0){
                                                    @hasMan = true;
                                                    <tr>
                                                        <td>
                                                        <input class="textbox" value="${ele.deptName}" id="dept" type="text" readonly="readonly">
                                                        <input class="textbox" value="${ele.deptId}" type="hidden" id="dept_id" name="dept_id">
                                                        </td>
                                                        <td>
                                                        <input class="textbox" value="${ele.roleNames}" id="role" type="text" readonly="readonly" >
                                                        <input class="textbox" value="${ele.roleIds}" type="hidden" id="role_id" name="role_id">
                                                        </td>
                                                    </tr>
                                                    @}
                                                @}
                                            @}
                                            @if(!hasMan){
                                            <tr>
                                                <td>
                                                <input class="textbox" id="dept" type="text" readonly="readonly">
                                                <input class="textbox" type="hidden" id="dept_id" name="dept_id">
                                                </td>
                                                <td>
                                                <input class="textbox" id="role" type="text" readonly="readonly" >
                                                <input class="textbox" type="hidden" id="role_id" name="role_id">
                                                </td>
                                            </tr>
                                            @}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">兼职部门</label>
                                <div class="col-sm-9">
                                    <table class="table table-bordered">
                                        <thead>
                                            <tr>
                                                <th width="40%">部门</th>
                                                <th>角色</th>
                                            </tr>
                                        </thead>
                                        <tbody id="_tbody">
                                            @if(!isEmpty(deptRoles)){
                                                @for(ele in deptRoles){
                                                    @if(ele.isPartTime==1){
                                                    <tr>
                                                        <td>
                                                        <input class="textbox" value="${ele.deptName}" id="dept_${eleLP.index}" type="text" readonly="readonly">
                                                        <input class="textbox" value="${ele.deptId}" type="hidden" id="dept_${eleLP.index}_id" name="dept_id">
                                                        </td>
                                                        <td>
                                                        <input class="textbox" value="${ele.roleNames}" id="role_${eleLP.index}" type="text" readonly="readonly" >
                                                        <input class="textbox" value="${ele.roleIds}" type="hidden" id="role_${eleLP.index}_id" name="role_id">
                                                        </td>
                                                    </tr>
                                                    @}
                                                @}
                                            @}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row btn-group-m-t">
                        <div class="col-sm-12" id="insertCancel">
                            <#Button btnCss="info" name="保存" id="ensure" icon="fa fa-check" clickFun="UserInfoDlg.personalEdit()"/>
                            @if(!isEmpty(emptyCancel)){
                            <#Button btnCss="l-bt-red" name="关闭" id="cancel" icon="fa fa-remove" clickFun="UserInfoDlg.returnUserInf()"/>
                            @}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/backend/system/user/user_info.js"></script>
@}
